<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style/global.css" />
<link rel="stylesheet" type="text/css" href="style/openwindow.css" />
<script src="js/jquery.js"></script>
<script src="js/comm.js"></script>
<script>
function setUsers(){
	//window.parent.document.getElementById("txtchoose").value = "选择了：外科/男性/全部年龄段 病人";
	JYCsm.closeWindow();
}
function setChoose(obj){
	$('#txtchoose').val($('#'+obj).attr("info"));
}
</script>
<style type='text/css'>
.cur{
	color:white;
	background:#cccccc;
}
</style>
</head>
<body>
<div id="warp">
<table class="tableGray" width="100%" border="0" cellpadding="0"
	cellspacing="1">
	<tr>
		<th width="100" class="pretitle">选择科室</th>
		<td>
			<a href="" nums='3022' class="dep cur">内科</a> 
			<a href="" nums='2894' class="dep">外科</a> 
			<a href="" nums='1098' class="dep">妇产科</a> 
			<a href="" nums='3687' class="dep">儿科</a>
			<a href="" nums='5134' class="dep">耳鼻喉科</a> 
			<a href="" nums='2479' class="dep">眼科</a> 
			<a href="" nums='4871' class="dep">口腔科</a>
		</td>
	</tr>
	<tr>
		<th width="100" class="pretitle">选择性别</th>
		<td><input type="radio" value="13" opt='1' checked name="sex"></input>全部 <input type="radio"
			value="14" opt='0.55' name="sex"></input> 男 <input opt='0.45' type="radio" value="15" name="sex"></input> 女</td>
	</tr>
	<tr>
		<th class="pretitle">选择年龄段</th>
		<td>
			<input type="radio" value="16" opt='1' checked name="age"> 全部<input type="radio" value="16" opt='0.3' name="age"> < 20岁<input type="radio" value="17" opt='0.15' name="age"> 20～30岁<input type="radio" value="18" opt='0.2' name="age"> 31～50岁<input type="radio" value="19" opt='0.35' name="age"> >50岁 </td>
	</tr>
	<tr>
		<th class="pretitle"></th>
		<td><input type="button" class="btn" value="选择"
			href="javascript:art.dialog.data.setChoose('alist_11')"
			info="总共 100 人" id="alist_11" />&nbsp;&nbsp; <span id='nums'>总计：&nbsp;<span id="tolnums"
			class='red'></span>&nbsp;人</span></td>
	</tr>
</table>
</div>
</body>
</html>
<script src="/js/xheditor/jquery/jquery-1.4.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$('#tolnums').html($('a.cur').attr('nums'))
$('a.dep').click(function(){
	$('a.dep').removeClass('cur')
	$(this).addClass('cur')
	var nums = $(this).attr('nums')
	var optsex = $('input[name="sex"]:checked').attr('opt')
	var optage = $('input[name="age"]:checked').attr('opt')
	var num = Math.round(nums * optsex * optage)
	$('#tolnums').html(num)
	return false;
})
$('input[name="sex"]').click(function(){
	if(this.checked){
		var nums = parseInt($('a.cur').attr('nums'))
		var optsex = $(this).attr('opt')
		var optage = $('input[name="age"]:checked').attr('opt')
		var num = Math.round(nums * optsex * optage)
		$('#tolnums').html(num)
	}
})
$('input[name="age"]').click(function(){
	if(this.checked){
		var nums = parseInt($('a.cur').attr('nums'))
		var optsex = $('input[name="sex"]:checked').attr('opt')
		var optage = $(this).attr('opt')
		var num = Math.round(nums * optsex * optage)
		$('#tolnums').html(num)
	}
})
$('input[type="button"]').click(function(){
	var msg = $('a.cur').html();
	msg += '('
	msg += $('input[name="sex"]:checked')[0].nextSibling.nodeValue
	if($('input[name="age"]:checked').attr('opt') != 1){
		msg += $('input[name="age"]:checked')[0].nextSibling.nodeValue
	}	
	msg += ')'
	msg += ' 共：'+$('#tolnums').html()+' 人'
	$(window.parent.document).find('#fmMainContents').contents().find('#txtchoose').val(msg)
	JYCsm.closeWindow();
})
</script>